const Mysql=require('./base')

class ShopCard extends Mysql{

  async Shops(id,nums){
  let result= await this.insert('INSERT INTO shopcard(good,nums)VALUE(?,?)',[id,nums])
  return result.rows
  }

  async Goods(){
    return await this.select('SELECT s.nums,g.title,g.thumbnail,g.price,g.unit,g.category FROM  shopcard AS s INNER JOIN goods AS g ON s.good=g.id')
    
  }

}

module.exports=new ShopCard();